import items.Item;
import items.ItemState;
import game.Game;
import room.*;
import commands.*;


public class TestGame
{
  public Game g;
  /**
   * @param args
   */
  public TestGame()
  {
    g = new Game();
    Room newRoom = g.createRoom();
    newRoom.setName("Luis' Room");
    
    g.setCurrentRoom(newRoom);
    
    RoomState crs = newRoom.getCurrentState();
    crs.setDescription("This is the description for room state 0\n");
    
    Commands temp;
    
    temp = crs.addVerb("look");
    temp.add(new SayDescription(crs));
    temp.add(new Say("btw this is state 0, there is a rock on the floor.\n"));
    
    Item itemRock = newRoom.createItem();
    itemRock.setName("rock");
 
    temp = crs.addVerb("kick");
    temp.add(new Say("You kicked the rock, wanna a cookie?\n"));
    temp.add(new RemoveItem(newRoom.getItems(), itemRock));
    temp.add(new ChangeState(newRoom, 1));
    
    ItemState irs = itemRock.getCurrentState();
    irs.setDescription("looks like a normal rock.\n");
    
    temp = irs.addVerb("onTake");
    temp.add(new MoveItem(newRoom.getItems(), g.getInventory(), itemRock));
    temp.add(new Say("You take the rock.\n"));
    temp.add(new SayDescription(irs));
    temp.add(new ChangeState(newRoom, 1));
    
    temp = irs.addVerb("kick");
    temp.add(new Say("You kicked the rock...\n"));
    temp.add(new MoveItem(g.getInventory(), newRoom.getItems(), itemRock));
    temp.add(new ChangeState(newRoom, 0));
    
    RoomState rs2 = newRoom.createRoomState();
    
    temp = rs2.addVerb("look");
    temp.add(new Say("Hi Room State 1\n"));
    
    temp = rs2.addVerb("onEnterState"); // preset verb
    temp.add(new Say("Entering RoomState 1\n"));
    
    temp = rs2.addVerb("kick");
    temp.add(new Say("There is nothing to kick\n"));

    temp = rs2.addItemReaction(itemRock);
    temp.add(new Say("Why did you use the rock??\n"));
    //temp.add(new ChangeState(newRoom, 0));
    
    Item itemFlashLight = newRoom.createItem();
    itemFlashLight.setName("flashlight");
    
    irs = itemFlashLight.getCurrentState();
    irs.setDescription("The flashlight is off.\n");
    
    temp = irs.addVerb("onTake");
    temp.add(new MoveItem(newRoom.getItems(), g.getInventory(), itemFlashLight));
    
    temp = irs.addVerb("switch");
    temp.add(new Say("You turned on the flashlight.\n"));
    temp.add(new ChangeItemState(itemFlashLight, 2));
    //temp.add(new SayDescription(irs));
    
    irs = itemFlashLight.createItemState();
    irs.setDescription("The flashlight is on.\n");
    
    temp = irs.addVerb("switch");
    temp.add(new Say("You turned off the flashlight.\n"));
    temp.add(new ChangeItemState(itemFlashLight, 1));
  }

}
